#ifndef YUVLOADER_H
#define YUVLOADER_H

#include <QObject>
#include <QFile>
#include <QDataStream>
#include <QTimer>

struct YUVData {
    QByteArray Y;
    QByteArray U;
    QByteArray V;
    int yLineSize;
    int uLineSize;
    int vLineSize;
    int height;
};
Q_DECLARE_METATYPE(YUVData);

class YUVLoader : public QObject
{
    Q_OBJECT
public:
    explicit YUVLoader(QObject *parent = nullptr);
    ~YUVLoader();    

public slots:
    void onFrameTimer();

signals:
    void newFrameAvailable(const YUVData& frame);

private:
    QFile m_file;
    QDataStream m_stream;
    QTimer m_frameTimer;
};

#endif // YUVLOADER_H
